<template>
  <div class="demo">
    <h2>学生名称：{{ name }}</h2>
    <h2>学生年龄：{{ age }}</h2>
    <button @click="showInfo">点我提示学校名</button>
  </div>
</template>

<script>
export default {
  name:'Student',
  data() {
    return {
      name: "詹姆斯",
      sex: '男',
      age:18
    };
  },
  methods: {
    showInfo() {
      alert("学生名：" + this.schoolName);
    },
  },
}
</script>

<style>
.demo{
  background-color: orange;
}
</style>